-- Decompiled with the Synapse X Luau decompiler.

local CommonOHOH = _G.CommonOHOH;
local GameAnalytics = CommonOHOH.load.GameAnalytics();
local GAConfig =CommonOHOH.load.GAConfig();
_G.GameAnalytics = GameAnalytics;

--local gameKey = options["gameKey"]
--local secretKey = options["secretKey"]

GameAnalytics:initialize({
	--build = GAConfig.Build, 
	gameKey = GAConfig.GameKey, 
	secretKey = GAConfig.SecretKey, 
	--enableInfoLog = false, 
	--enableVerboseLog = false, 
	--useCustomUserId = true, 
	--enableDebugLog = false, 
	--automaticSendBusinessEvents = true, 
	--reportErrors = true, 
	
	--availableCustomDimensions01 = {},
	--availableCustomDimensions02 = {},
	--availableCustomDimensions03 = {},
	--availableResourceCurrencies = {},
	--availableResourceItemTypes = {},
	--availableGamepasses = {}
	
});
--GameAnalytics:setEnabledInfoLog(true);
--GameAnalytics:setEnabledVerboseLog(true);

local M = {}
--通过关卡后上传数据
--playerId 玩家id
--level_id 通关后所在的关卡数
--pet_boost 所有出战的宠物，加成总和
--glove_id 携带的拳套id
--strength_num 通关时的力量值
--win_num 通关时的奖杯数
--rebirth_times 通关时的重生次数
--training_times 从原关卡到新关卡期间，训练次数，需要记录，通过后清零重新记录
--attack_wall_times 从原关卡到新关卡期间，破墙次数，需要记录，通过后清零重新记录

function M.AddProgressionStageEvent(self, playerId, level_id, pet_boost, glove_id, strength_num, win_num, rebirth_times, training_times, attack_wall_times)
    _G.GameAnalytics:addProgressionEvent(playerId, {
		progressionStatus = _G.GameAnalytics.EGAProgressionStatus.Complete,
		progression01 = "stage",
		progression02 = "level_id",
		score = level_id
	})

	_G.GameAnalytics:addProgressionEvent(playerId, {
		progressionStatus = _G.GameAnalytics.EGAProgressionStatus.Complete,
		progression01 = "stage",
		progression02 = "pet_boost",
		score = pet_boost
	})

	_G.GameAnalytics:addProgressionEvent(playerId, {
		progressionStatus = _G.GameAnalytics.EGAProgressionStatus.Complete,
		progression01 = "stage",
		progression02 = "glove_id",
		score = glove_id
	})

	_G.GameAnalytics:addProgressionEvent(playerId, {
		progressionStatus = _G.GameAnalytics.EGAProgressionStatus.Complete,
		progression01 = "stage",
		progression02 = "strength_num",
		score = strength_num
	})

	_G.GameAnalytics:addProgressionEvent(playerId, {
		progressionStatus = _G.GameAnalytics.EGAProgressionStatus.Complete,
		progression01 = "stage",
		progression02 = "win_num",
		score = win_num
	})

	_G.GameAnalytics:addProgressionEvent(playerId, {
		progressionStatus = _G.GameAnalytics.EGAProgressionStatus.Complete,
		progression01 = "stage",
		progression02 = "rebirth_times",
		score = rebirth_times
	})

	_G.GameAnalytics:addProgressionEvent(playerId {
		progressionStatus = _G.GameAnalytics.EGAProgressionStatus.Complete,
		progression01 = "stage",
		progression02 = "training_times",
		score = training_times
	})

	_G.GameAnalytics:addProgressionEvent(playerId, {
		progressionStatus = _G.GameAnalytics.EGAProgressionStatus.Complete,
		progression01 = "stage",
		progression02 = "attack_wall_times",
		score = attack_wall_times   
	})
end


--成功重生后上传数据
--playerId 玩家id
--level_id 通关后所在的关卡数
--pet_boost 所有出战的宠物，加成总和
--glove_id 携带的拳套id
--strength_num 通关时的力量值
--win_num 通关时的奖杯数
--rebirth_times 通关时的重生次数
--training_times 从原关卡到新关卡期间，训练次数，需要记录，通过后清零重新记录
--attack_wall_times 从原关卡到新关卡期间，破墙次数，需要记录，通过后清零重新记录

function M.AddProgressionRebirthEvent(self, playerId, level_id, pet_boost, glove_id, strength_num, win_num, rebirth_times, training_times)
    _G.GameAnalytics:addProgressionEvent(playerId, {
		progressionStatus = _G.GameAnalytics.EGAProgressionStatus.Complete,
		progression01 = "rebirth",
		progression02 = "level_id",
		score = level_id
	})

	_G.GameAnalytics:addProgressionEvent(playerId, {
		progressionStatus = _G.GameAnalytics.EGAProgressionStatus.Complete,
		progression01 = "rebirth",
		progression02 = "pet_boost",
		score = pet_boost
	})

	_G.GameAnalytics:addProgressionEvent(playerId, {
		progressionStatus = _G.GameAnalytics.EGAProgressionStatus.Complete,
		progression01 = "rebirth",
		progression02 = "glove_id",
		score = glove_id
	})

	_G.GameAnalytics:addProgressionEvent(playerId, {
		progressionStatus = _G.GameAnalytics.EGAProgressionStatus.Complete,
		progression01 = "rebirth",
		progression02 = "strength_num",
		score = strength_num
	})

	_G.GameAnalytics:addProgressionEvent(playerId, {
		progressionStatus = _G.GameAnalytics.EGAProgressionStatus.Complete,
		progression01 = "rebirth",
		progression02 = "win_num",
		score = win_num
	})

	_G.GameAnalytics:addProgressionEvent(playerId, {
		progressionStatus = _G.GameAnalytics.EGAProgressionStatus.Complete,
		progression01 = "rebirth",
		progression02 = "rebirth_times",
		score = rebirth_times
	})

	_G.GameAnalytics:addProgressionEvent(playerId {
		progressionStatus = _G.GameAnalytics.EGAProgressionStatus.Complete,
		progression01 = "rebirth",
		progression02 = "training_times",
		score = training_times
	})

end

--成功购买拳套后后上传数据
--playerId 玩家id
--buyGlove_id 购买拳套id
--level_id 所在的关卡数
--pet_boost 所有出战的宠物，加成总和
--glove_id 携带的拳套id
--strength_num 购买后的力量值
--win_num 购买后的奖杯数
--rebirth_times 此时的重生次数

function M.AddProgressionGlovesEvent(self, playerId, buyGlove_id, level_id, pet_boost, glove_id, strength_num, win_num, rebirth_times)
    _G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "gloves:buyGlove_id",
		value = buyGlove_id
	})
	
	_G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "gloves:level_id",
		value = level_id
	})
	
	_G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "gloves:pet_boost",
		value = pet_boost
	})

    _G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "gloves:glove_id",
		value = glove_id
	})
	
	
	_G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "gloves:strength_num",
		value = strength_num
	})


	_G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "gloves:win_num",
		value = win_num
	})
	
	_G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "gloves:rebirth_times",
		value = rebirth_times
	})
	
end


--成功购买拖尾后后上传数据
--playerId 玩家id
--trail_id 购买拖尾id
--level_id 所在的关卡数
--pet_boost 所有出战的宠物，加成总和
--glove_id 携带的拳套id
--strength_num 购买后的力量值
--win_num 购买后的奖杯数
--rebirth_times 此时的重生次数

function M.AddProgressionTrailEvent(self, playerId, trail_id, level_id, pet_boost, glove_id, strength_num, win_num, rebirth_times)
    _G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "trail:trail_id",
		value = trail_id
	})
	
	_G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "trail:level_id",
		value = level_id
	})
	
	_G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "trail:pet_boost",
		value = pet_boost
	})

    _G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "trail:glove_id",
		value = glove_id
	})
	
	
	_G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "trail:strength_num",
		value = strength_num
	})


	_G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "trail:win_num",
		value = win_num
	})
	
	_G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "trail:rebirth_times",
		value = rebirth_times
	})
	
end



--成功购买扭蛋后后上传数据
--playerId 玩家id
--trail_id 扭蛋的蛋id
--pet_id 抽到的宠物id
--level_id 所在的关卡数
--pet_boost 所有出战的宠物，加成总和
--glove_id 携带的拳套id
--strength_num 购买后的力量值
--win_num 购买后的奖杯数
--rebirth_times 此时的重生次数

function M.AddProgressionHatchEvent(self, playerId, egg_id, pet_id, level_id, pet_boost, glove_id, strength_num, win_num, rebirth_times)
    _G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "hatch:egg_id",
		value = egg_id
	})

    _G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "hatch:pet_id",
		value = pet_id
	})
	
	_G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "hatch:level_id",
		value = level_id
	})
	
	_G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "hatch:pet_boost",
		value = pet_boost
	})

    _G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "hatch:glove_id",
		value = glove_id
	})
	
	
	_G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "hatch:strength_num",
		value = strength_num
	})


	_G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "hatch:win_num",
		value = win_num
	})
	
	_G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "hatch:rebirth_times",
		value = rebirth_times
	})
	
end


--成功购买后上传数据
--playerId 玩家id
--item_id 商品id
--level_id 所在的关卡数
--pet_boost 所有出战的宠物，加成总和
--glove_id 携带的拳套id
--strength_num 购买后的力量值
--win_num 购买后的奖杯数
--rebirth_times 此时的重生次数

function M.AddProgressionPurchaseEvent(self, playerId, item_id,  level_id, pet_boost, glove_id, strength_num, win_num, rebirth_times)
    _G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "purchase:item_id",
		value = item_id
	})

	_G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "purchase:level_id",
		value = level_id
	})
	
	_G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "purchase:pet_boost",
		value = pet_boost
	})

    _G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "purchase:glove_id",
		value = glove_id
	})
	
	
	_G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "purchase:strength_num",
		value = strength_num
	})


	_G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "purchase:win_num",
		value = win_num
	})
	
	_G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "purchase:rebirth_times",
		value = rebirth_times
	})
	
end


--成功邀请后上传数据
--playerId 玩家id
--invite_num 邀请成功后的累计邀请数

function M.AddProgressionInviteEvent(self, playerId, invite_num)
    _G.GameAnalytics:addDesignEvent(playerId, {
		eventId = "invite:invite_num",
		value = invite_num
	})
end


return M;
